import axios from '../axios';
import { ADMIN_TEACHER } from '../../CONST';
export default {
    /**
     * @parmas 增加讲师{"avatar": "string","career": "string","education": "string","id": 0,"isFamous": "string","name": "string","status": "string","subjectId": 0}
     */
    addTeacherApi(params) {
        console.log('发往后端', params);
        return axios({
            url: ADMIN_TEACHER + '/add',
            method: 'post',
            data: params,
            headers: { 'Content-Type': 'application/json', 'accept': '*/*' }
        })
    },
    /**
     * @parmas 删除讲师 讲师id
     */
    delTeacherApi(params) {
        console.log(params, '删除');
        return axios({
            url: ADMIN_TEACHER + `/del?id1=${params}`,
            method: 'post',
        })
    },
    /**
     * @parmas 无参 获取讲师列表
     */
    getTeacherListApi({ currentPage = 1, pageSize = 2 }) {
        return axios({
            url: ADMIN_TEACHER + `/list?currentPage=${currentPage}&pageSize=${pageSize}`,
            method: 'get',
        })
    },
    /**
     * @parmas 上传讲师头像
     */
    uploadTeacherImgApi(params) {
        return axios({
            url: ADMIN_TEACHER + '/upload',
            method: 'post',
            data: params,
            headers: { 'Content-Type': 'application/json', 'accept': '*/*' }
        })
    },

}